// promise 的使用
{
  // promise all

  let load = function (imgUrl) {
    return new Promise((res, rej) => {
      let img = document.createElement('img');
      img.src = imgUrl;
      img.onload = () => {
        res(img);
      };
    });
  };

  Promise.all([
    load(
      'https://pic2.zhimg.com/50/v2-2038cd0997d58ff893d433761b90c102_hd.webp'
    ),
    load(
      'https://pic2.zhimg.com/50/v2-5fbdde3dbc80b96d958c1f88538af53c_hd.webp'
    ),
    load(
      'https://pic1.zhimg.com/50/v2-9fd7541c7301086b5ece514e012f4b65_hd.webp'
    )
  ]).then((img) => [
    img.forEach((item) => {
      document.body.appendChild(item);
    })
  ]);
}
